<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery-3.3.1.min.js"></script>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }
        
        body {
            text-align: center;
        }
        
        .img {
            width: 400px;
            margin: 0 auto;
        }
        
        .search {
            width: 600px;
            height: 50px;
            margin: 0 auto;
        }
        
        .search>input {
            width: 480px;
            height: 48px;
            float: left;
            line-height: 30px;
            overflow: hidden;
            box-sizing: content-box;
            border: 2px solid #c4c7ce;
            border-radius: 10px 0 0 10px;
        }
        
        .search>button {
            width: 100px;
            height: 50px;
            float: left;
            background-color: #4e6ef2;
            border-radius: 0 10px 10px 0;
            font-size: 17px;
            color: #fff;
            box-shadow: none;
            font-weight: 400;
            border: none;
            outline: 0;
        }
        
        a {
            text-decoration: none;
            color: black;
        }
        
        .container {
            width: 800px;
            height: 400px;
            margin: 0 auto;
            margin-top: 30px;
        }
        
        .menu {
            width: 150px;
            height: 400px;
            float: left;
        }
        
        .menu>span {
            float: left;
            width: 150px;
            height: 50px;
            color: white;
            line-height: 50px;
            opacity: 0.4;
            background-color: black;
        }
        
        .menu>div {
            float: left;
            width: 150px;
            height: 200px;
            background-color: black;
            opacity: 0.4;
        }
        
        .choose {
            opacity: 0.8;
        }
        
        .card {
            width: 600px;
            height: 400px;
            background-color: black;
            opacity: 0.3;
            float: right;
        }
        
        .xingzuo>div {
            margin-top: 10px;
            margin-left: 10px;
            width: 135px;
            float: left;
            height: 80px;
            border: 1px solid white;
            color: white;
        }
    </style>
</head>

<body>
    <img src="baidu.png" alt="" class="img">
    <p class="links">
        <a href="http://news.baidu.com" target="_blank">新闻</a>
        <a href="http://www.baidu.com" target="_blank">网页</a>
        <a href="http://tieba.baidu.com" target="_blank">贴吧</a>
        <a href="http://zhidao.baidu.com" target="_blank">知道</a>
        <a href="http://music.baidu.com" target="_blank">音乐</a>
        <a href="http://image.baidu.com" target="_blank">图片</a>
        <a href="http://v.baidu.com" target="_blank">视频</a>
        <a href="http://map.baidu.com" target="_blank">地图</a>
        <a href="http://baike.baidu.com" target="_blank">百科</a>
        <a href="http://wenku.baidu.com" target="_blank">文库</a>
        <a href="http://www.baidu.com/more/" target="_blank">更多&gt;&gt;</a>
    </p>
    <div class="search">
        <input type="text"><button>百度一下</button>
    </div>
    <div class="container">
        <div class="menu">
            <span>导航</span>
            <span>音乐</span>
            <span>新闻</span>
            <span class="choose" style="opacity: 0.8;">星座</span>
            <div></div>
        </div>
        <div class="card">
            <div class="xingzuo">
            </div>
        </div>
    </div>

    <script>
        var data = [{
            name: '白羊座',
            time: '3.21-4.19'
        }, {
            name: '金牛座',
            time: '4.20-5.20'
        }, {
            name: '双子座',
            time: '5.21-6.21'
        }, {
            name: '巨蟹座',
            time: '6.22-7.22'
        }, {
            name: '狮子座',
            time: '7.23-8.22'
        }, {
            name: '处女座',
            time: '8.23-9.22'
        }, {
            name: '天秤座',
            time: '9.23-10.23'
        }, {
            name: '天蝎座',
            time: '10.24-11.22'
        }, {
            name: '射手座',
            time: '11.23-12.21'
        }, {
            name: '摩羯座',
            time: '12.22-1.19'
        }, {
            name: '水瓶座',
            time: '1.20-2.18'
        }, {
            name: '双鱼座',
            time: '2.19-3.20'
        }];

        $(".menu span").toArray();
        $(".menu span").hover(function() {
            $(".menu span").each(function() {
                $(this).removeClass("choose");
                $(this).css("opacity", 0.4);
            })
            $(this).addClass("choose");
            $(this).css("opacity", 0.8);
        });
        for (var i = 0; i < data.length; i++) {
            var s = "<div>";
            for (var key in data[i]) {
                s += "<p>" + data[i][key] + "</p>"
            }
            s += "</div>"
            $(".xingzuo").append(s);
        }
    </script>
</body>

</html>